# coding: utf-8
from marshmallow import Schema, fields
from model.model_base import Base
from sqlalchemy import Column, String, Integer, Numeric


class PendingProSupType(Base):
    # 待处理问题统计表（按故障督办）
    __tablename__ = 'PendingProSupType'
    bureauid = Column(String(2), primary_key=True, comment='供电局编号')
    bureauname = Column(String(50), nullable=True, comment='供电局名称')
    stationid = Column(String(2), primary_key=True, comment='供所编号')
    stationname = Column(String(50), nullable=True, comment='供电所名称')
    pending_number = Column(Integer, nullable=True, comment='待处理问题总数')
    pending_percent = Column(Numeric(5,2), nullable=True, comment='待处理问题占比')
    problemid = Column(String(2), primary_key=True, comment='问题编号')
    problemname = Column(String(50), nullable=True, comment='问题名称')


class PendingProSupTypeSchema(Schema):
    bureauid = fields.String()
    bureauname = fields.String()
    stationid = fields.String()
    stationname = fields.String()
    pending_number = fields.Integer()
    pending_percent = fields.Number()
    problemid = fields.String()
    problemname = fields.String()


pendingProSupTypeSchema = PendingProSupTypeSchema()



